package com.cool.modules.finance.constant;

import lombok.Getter;

@Getter
public enum TransferType {

    TRANSFER(1, "转账"),
    REPAYMENT(2, "赎回"),
    REPAYMENT_BACK(3, "还款"),
    BALANCE_ACCOUNT(4, "平账");

    private final Integer type;

    private final String desc;

    TransferType(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static String getByType(Integer type) {
        for (TransferType transferType : TransferType.values()) {
            if (transferType.getType().equals(type)) {
                return transferType.getDesc();
            }
        }
        return null;
    }
}
